<?php 
$sql="SELECT role, administrator_id, name, description FROM enroll INNER JOIN courses ON enroll.course_id=courses.id WHERE user_id=".$_COOKIE["user_id"]."and course_id=".$_GET["id"];
$result=mysql_query($sql);
$rows=mysql_num_rows($result);
if($rows)
{
	if(role==0)
	{
		//student
		$u=1;
	}
	else
	{
		//TA
		$u=2;
	}
}
else
{
	//not enroll
	$i=0;
}
$row=mysql_fetch_array($result);
if($row["administrator_id"]==$_COOKIE["user_id"])
{
	//teacher
	$u=3;
}
$coursename=$row["name"];
$description=$row["description"];
?>